package com.t14;

import org.junit.Test;

import java.lang.reflect.Proxy;

/**
 * Created by xuyiwei on 2018/8/11.
 */
public class ProxyTest {
    @Test
    public void proxyTest() throws Exception {
        Car audi = (Car) Proxy.newProxyInstance(Car.class.getClassLoader(), new Class<?>[] {Car.class}, new CarHandler(new Audi()));
        audi.drive("name1", "audi");
    }
}
